import * as THREE from "three"
import o from "../shader/31090"
import a from "../shader/69383"
import ae from "../shader/34086"
import be from "../shader/36888"
import ce from "../shader/18934"
import de from "../shader/7532"
import ee from "../shader/18144"
import fe from "../shader/81713"
import funcUtil from "../utils/func.util"
const l = {
  pinHead: {
    uniforms: {
      alpha: { type: "f", value: 1 },
      color: { type: "c", value: new THREE.Color() },
      bg: { type: "t", value: null },
      mask: { type: "t", value: null }
    },
    vertexShader: funcUtil.addNR(a, ae),
    fragmentShader: funcUtil.addNR(o, be)
  },
  pinStem: {
    uniforms: {
      pinHeadMatrix: { value: new THREE.Matrix4() },
      resolution: { value: new THREE.Vector2() },
      alpha: { value: 1 }
    },
    vertexShader: funcUtil.addNR(a, ce),
    fragmentShader: funcUtil.addNR(o, de)
  },
  pinSelected: {
    vertexShader: funcUtil.addNR(a, ee),
    fragmentShader: funcUtil.addNR(o, fe)
  }
}
import c from "../shader/79826"
import h from "../shader/64715"
import configConst from "../constant/config.const"

export class PinHeadMaterial extends THREE.RawShaderMaterial {
  constructor(e, t, i, n) {
    const r = THREE.UniformsUtils.clone(l.pinHead.uniforms)
    r.bg.value = t
    r.mask.value = i
    r.color.value.copy(e)
    r.alpha.value = n
    super({
      fragmentShader: l.pinHead.fragmentShader,
      vertexShader: l.pinHead.vertexShader,
      uniforms: r,
      name: "PinHeadMaterial",
      transparent: !0
    })
  }
}
export class PinStemMaterial extends THREE.RawShaderMaterial {
  constructor() {
    const e = THREE.UniformsUtils.clone(l.pinStem.uniforms)
    super({
      fragmentShader: l.pinStem.fragmentShader,
      vertexShader: l.pinStem.vertexShader,
      uniforms: e,
      name: "PinStemMaterial",
      linewidth: configConst.PlaneBufferGeometryConfg.stem.width,
      opacity: configConst.PlaneBufferGeometryConfg.stem.opacity,
      transparent: configConst.PlaneBufferGeometryConfg.stem.transparent,
      alphaTest: configConst.PlaneBufferGeometryConfg.stem.opacity * configConst.PlaneBufferGeometryConfg.stem.alphaTest
    })
  }
}
export class InstancedPinStemMaterial extends THREE.RawShaderMaterial {
  constructor() {
    const e = THREE.UniformsUtils.clone(l.pinStem.uniforms)
    super({
      defines: { INSTANCED: !0 },
      fragmentShader: l.pinStem.fragmentShader,
      vertexShader: l.pinStem.vertexShader,
      uniforms: e,
      name: "InstancedPinStemMaterial",
      linewidth: configConst.PlaneBufferGeometryConfg.stem.width,
      opacity: configConst.PlaneBufferGeometryConfg.stem.opacity,
      transparent: configConst.PlaneBufferGeometryConfg.stem.transparent,
      alphaTest: configConst.PlaneBufferGeometryConfg.stem.opacity * configConst.PlaneBufferGeometryConfg.stem.alphaTest
    })
  }
}
export class InstancedPinHeadMaterial extends THREE.RawShaderMaterial {
  constructor(e, t) {
    const i = THREE.UniformsUtils.clone(l.pinHead.uniforms)
    i.bg.value = e
    i.mask.value = t
    super({
      defines: { INSTANCED: !0 },
      fragmentShader: l.pinHead.fragmentShader,
      vertexShader: l.pinHead.vertexShader,
      uniforms: i,
      name: "InstancedPinHeadMaterial",
      transparent: !0
    })
  }
}
export class PinHeadCustomMaterial extends THREE.RawShaderMaterial {
  constructor(e, t) {
    super({
      defines: { INSTANCED: t },
      vertexShader: funcUtil.addNR(a, c),
      fragmentShader: funcUtil.addNR(o, h),
      uniforms: { alpha: { value: 1 }, tDiffuse: { value: e } },
      name: "InstancedPinHeadCustomMaterial",
      transparent: !0
    })
  }
}
export class PinSelectedMaterial extends THREE.RawShaderMaterial {
  constructor() {
    super({
      depthTest: !0,
      depthWrite: !1,
      transparent: !0,
      side: THREE.DoubleSide,
      vertexShader: l.pinSelected.vertexShader,
      fragmentShader: l.pinSelected.fragmentShader
    })
  }
}
